﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Enterprise.Migrations
{
    public partial class AddHisGlucoseRec : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "HIS_GLUCOSE_REC",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    PATIENT_ID = table.Column<string>(type: "VARCHAR(20)", nullable: true),
                    VISIT_ID = table.Column<string>(type: "VARCHAR(20)", nullable: true),
                    RECORDING_DATE = table.Column<DateTime>(type: "DATE", nullable: false),
                    TIME_POINT = table.Column<DateTime>(type: "DATETIME", nullable: false),
                    SIMPLE_TYPE_CODE = table.Column<string>(type: "VARCHAR(20)", nullable: true),
                    SIMPLE_ITEM_CODE = table.Column<int>(type: "INT", nullable: false),
                    SIMPLE_ITEM_NAME = table.Column<string>(type: "VARCHAR(60)", nullable: true),
                    GLUCOSE_VALUES = table.Column<decimal>(type: "DECIMAL(3,1)", nullable: false),
                    MEMO = table.Column<string>(type: "VARCHAR(100)", nullable: true),
                    CREATED_BY = table.Column<string>(type: "VARCHAR(20)", nullable: true),
                    CREATED_BY_NAME = table.Column<string>(type: "VARCHAR(20)", nullable: true),
                    CREATED_TIME = table.Column<DateTime>(type: "DATETIME", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_HIS_GLUCOSE_REC", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "HIS_GLUCOSE_REC");
        }
    }
}
